package cn.zwk.drawing.domain.diagram.model;

import lombok.Data;
import lombok.Builder;

/**
 * 图表连接关系领域实体
 */
@Data
@Builder
public class DiagramConnection {
    
    /**
     * 连接唯一标识
     */
    private String connectionId;
    
    /**
     * 源节点ID
     */
    private String sourceNodeId;
    
    /**
     * 目标节点ID
     */
    private String targetNodeId;
    
    /**
     * 连接类型
     */
    private ConnectionType type;
    
    /**
     * 连接标签
     */
    private String label;
    
    /**
     * 连接方向
     */
    private Direction direction;
    
    /**
     * 连接样式
     */
    private ConnectionStyle style;
    
    /**
     * 连接类型枚举
     */
    public enum ConnectionType {
        DEPENDENCY("dependency", "依赖"),
        COMMUNICATION("communication", "通信"),
        DATA_FLOW("dataflow", "数据流"),
        INHERITANCE("inheritance", "继承"),
        COMPOSITION("composition", "组合");
        
        private final String code;
        private final String description;
        
        ConnectionType(String code, String description) {
            this.code = code;
            this.description = description;
        }
        
        public String getCode() { return code; }
        public String getDescription() { return description; }
    }
    
    /**
     * 连接方向枚举
     */
    public enum Direction {
        UNIDIRECTIONAL("unidirectional", "单向"),
        BIDIRECTIONAL("bidirectional", "双向");
        
        private final String code;
        private final String description;
        
        Direction(String code, String description) {
            this.code = code;
            this.description = description;
        }
        
        public String getCode() { return code; }
        public String getDescription() { return description; }
    }
}

/**
 * 连接样式配置
 */
@Data
@Builder
class ConnectionStyle {
    
    /**
     * 线条颜色
     */
    private String color;
    
    /**
     * 线条样式
     */
    private String lineStyle;
    
    /**
     * 线条粗细
     */
    private Integer thickness;
    
    /**
     * 箭头样式
     */
    private String arrowStyle;
}